<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:include="login::nav">
</div>
<hr>
<div style="display: flex">
<div style="flex: 2">
    <table border="1">
        <tr>
            <td>ID</td>
            <td>老师编号</td>
            <td>老师姓名</td>
            <th>班级编号</th>
            <th>班级名称</th>
            <td>课程编号</td>
            <td>课程名称</td>
            <td>操作</td>
        </tr>
        <tr th:each="x:${task}">
            <td th:text="${x.kid}"></td>
            <td th:text="${x.user.uid}"></td>
            <td th:text="${x.user.uname}"></td>
            <td th:text="${x.clz.clzno}"></td>
            <td th:text="${x.clz.clzname}"></td>
            <td th:text="${x.course.cno}"></td>
            <td th:text="${x.course.cname}"></td>
            <td><a th:href="'/admtask/go2update?kid='+${x.kid}">修改</a></td>
            <td><a th:href="'/admtask/del?kid='+${x.kid}">删除</a></td>
        </tr>
    </table>
</div>
    <div style="flex: 1">
            <button><a href="/admtask/go2add">添加排课</a></button>
            <hr>
            <div th:if="${action}=='add'">
                <form action="/admtask/add" method="post">
                    教师:<select name="user.uid">
                    <option th:each="x:${user}" th:text="${x.uname}" th:value="${x.uid}"></option>
                </select><br>
                    班级:<select name="clz.clzno">
                    <option th:each="x:${clz}" th:text="${x.clzname}" th:value="${x.clzno}"></option>
                </select><br>
                    课程:<select name="course.cno">
                    <option th:each="x:${course}" th:text="${x.cname}" th:value="${x.cno}"></option>
                </select><br>
                    <input type="submit">
                </form>
            </div>
            <div th:if="${action}=='update'">
                <form action="/admtask/update" method="post">
                    kid:<input type="text" th:value="${kid}" ><br>
                    教师:<select name="user.uid">
                    <option th:each="x:${user}" th:text="${x.uname}" th:value="${x.uid}"></option>
                </select><br>
                    班级:<select name="clz.clzno">
                    <option th:each="x:${clz}" th:text="${x.clzname}" th:value="${x.clzno}"></option>
                </select><br>
                    课程:<select name="course.cno">
                    <option th:each="x:${course}" th:text="${x.cname}" th:value="${x.cno}"></option>
                </select><br>
                    <input type="submit">
                </form>
            </div>
        </div>
</div>
</body>
</html>